package org.parademo.model;

/**
 * @author Ajit Skanda
 * @version 1.0
 */

public enum ProposalStatus {
	CREATED,
	VOTABLE,
	SUBMITTED,
	ACCEPTED,
	REJECTED;

	public ProposalStatus fromString(String proposalStatusStr){
		if (ProposalStatus.CREATED.name().equals(proposalStatusStr) ) {
			return ProposalStatus.CREATED;
		} else if (ProposalStatus.VOTABLE.name().equals(proposalStatusStr) ) {
			return ProposalStatus.VOTABLE;
		} else if (ProposalStatus.SUBMITTED.name().equals(proposalStatusStr) ) {
			return ProposalStatus.SUBMITTED;
		} else if (ProposalStatus.ACCEPTED.name().equals(proposalStatusStr) ) {
			return ProposalStatus.ACCEPTED;
		} else if (ProposalStatus.REJECTED.name().equals(proposalStatusStr) ) {
			return ProposalStatus.REJECTED;
		} else {
			return null;
		}
	}
}
